import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:gameplay_flutter/lib_runtime/extension/widget/widget_wrapper.dart';
import 'package:gameplay_flutter/m_room/room_manager.dart';
import 'package:get_storage/get_storage.dart';
import 'package:ones/ui.dart';
import '../../../generated/assets.dart';
import '../../../lib_runtime/common/lanuage_util.dart';
import '../../../resource/language/generated/l10n.dart';
import 'fresh_components.dart';

class MineTabsWidget extends StatefulWidget {
  final callback;
  final controller;

  const MineTabsWidget({
    super.key,
    this.callback,
    required this.controller,
  });

  @override
  State<MineTabsWidget> createState() => _MineTabsWidget();
}

class _MineTabsWidget extends State<MineTabsWidget>
    with SingleTickerProviderStateMixin {
  final EasyRefreshController _refreshControllerRoom = EasyRefreshController();
  late TabController _tabController;
  bool hasMore = false;
  int queryType = 1;
  int currentId = 0;
  bool noMore = false;
  int pageNum = 1;
  final GetStorage box = GetStorage();

  @override
  void initState() {
    super.initState();
    _tabController = TabController(
      length: 3,
      vsync: this,
    );
    _tabController.addListener(() {
      setState(() {
        currentId = _tabController.index;
      });
      var typeIndex = 0;
      if(_tabController.index == 0){
        typeIndex = 2;
      }
      if(_tabController.index == 1){
        typeIndex = 1;
      }
      if(_tabController.index == 2){
        typeIndex = 0;
      }
      setState(() {
        queryType =
            widget.controller.roomTypesList.value[typeIndex].type;
      });
    });
  }

  Future<void> _onRefreshPopularRoom() async {
    // _refreshControllerMarket.finishRefresh(success: true);
     widget.controller.loadMineData(currentId, queryType,'refresh', 1);
     _refreshControllerRoom.finishRefresh();
  }

  Future<void> _onLoadRoom() async {
    if(!noMore){
      setState(() {
        pageNum++;
        hasMore = true;
      });
      print({ pageNum++,999999990});
      var status =  await widget.controller.loadMineData(currentId,queryType,'more', pageNum++);
      print(status);
      if(!status){
        _refreshControllerRoom.finishLoad(noMore: true,success: true);
      }

    } else {
      setState(() {
        noMore = false;
      });
      Future.delayed(Duration(milliseconds: 500), () {
        setState(() {
          noMore = true;
        });
      });
    }
    // _refreshControllerMarket.finishRefresh(success: true);
  }


  Widget _mineRecentlyRoomList(controller) {
    var mineRecentlyRoomList = widget.controller.recentlyRoomList.value;
    return EasyRefresh(
        onRefresh: _onRefreshPopularRoom,
        onLoad: _onLoadRoom,
        header: buildCustomHeader,
        footer:buildCustomFooter,
        controller: _refreshControllerRoom,
        child: mineRecentlyRoomList.length > 0? MasonryGridView.count(
          crossAxisCount: 1,
          mainAxisSpacing: 6,
          crossAxisSpacing: 4,
          itemCount: mineRecentlyRoomList.length,
          itemBuilder: (context, index) {
            var newColors = 0;
            var newBgColors = 0;
            final roomCategoryColor =
                mineRecentlyRoomList[index].roomCategoryColor;
            if (roomCategoryColor != null) {
              String color = '0xff' + roomCategoryColor.split('#')[1];
              newColors = color.toInt();
            } else {
              newColors = 0xfffffff;
            }
            final backgroundUrl = mineRecentlyRoomList[index].backgroundUrl;
            if (backgroundUrl != null) {
              String bgColor = '0xff' + backgroundUrl.split('#')[1];
              newBgColors = bgColor.toInt();
            } else {
              newBgColors = 0xfffffff;
            }
            return Container(
                decoration: const BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(5))
            ),
            padding: const EdgeInsets.symmetric(vertical: 5),
            child:Column(
              children: [
                Row(
                  children: [
                    // Image.asset(roomItem.roomIcon,width: 100,height: 100,),
                    Container(
                        width: 73,
                        height: 73,
                        margin: const EdgeInsets.only(left: 5),
                        decoration: ShapeDecoration(
                            image: DecorationImage(
                              // image:index % 2 == 0 ? AssetImage(Assets.homeAvatar1) : AssetImage(Assets.homeAvatar2),
                                image: NetworkImage(
                                    mineRecentlyRoomList[index].roomIcon ??
                                        ''),
                                fit: BoxFit.fitWidth),
                            shape: RoundedRectangleBorder(
                                borderRadius:
                                BorderRadiusDirectional.circular(8))),
                        // child: Stack(
                        //   children: [
                        //     Positioned(
                        //       left: -2,
                        //       top: -1,
                        //       child: Image(
                        //         image: mineRecentlyRoomList[index].isLock ??
                        //             false
                        //             ? AssetImage(Assets.mineRoomClose)
                        //             : AssetImage(Assets.mineRoomNew),
                        //         width: 40,
                        //         height: 16,
                        //       ),
                        //     ),
                        //     Positioned(
                        //       left: 8,
                        //       child: Text(
                        //           mineRecentlyRoomList[index].isLock ??
                        //               false
                        //               ? 'Hiding'
                        //               : 'New')
                        //           .color(Colors.white)
                        //           .fontSize(11),
                        //     )
                        //   ],
                        // )
                     ),
                    const SizedBox(
                      width: 5,
                    ),
                    Expanded(
                      child: SizedBox(
                        height: 73,
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  children: [
                                    // Image.network(mineRecentlyRoomList[index].countryUrl,width: 30,height: 20,),
                                    mineRecentlyRoomList[index].countryUrl !=
                                        null
                                        ? Image.network(
                                      mineRecentlyRoomList[index]
                                          .countryUrl,
                                      width: 30,
                                      height: 20,
                                    )
                                        : Image.asset(
                                      Assets.homeCountries,
                                      width: 30,
                                      height: 20,
                                    ),
                                    SizedBox(
                                      width: 3,
                                    ),
                                    SizedBox(
                                      width: 180,
                                      child: Text(
                                        mineRecentlyRoomList[index]
                                            .roomName ??
                                            '',
                                        softWrap: false,
                                        maxLines: 1,
                                        overflow: TextOverflow.ellipsis,
                                      ).fontSize(16),
                                    )
                                  ],
                                ),
                                Text(
                                  mineRecentlyRoomList[index].slogan ?? '',
                                  softWrap: false,
                                  maxLines: 1,
                                  overflow: TextOverflow.ellipsis,
                                ).fontSize(12).color(Color(0xffC1C1C1)),
                              ],
                            ),
                            Row(
                              children: [
                                mineRecentlyRoomList[index]
                                    .categoryTypeIcon !=
                                    null
                                    ? Image.network(
                                  mineRecentlyRoomList[index]
                                      .categoryTypeIcon ??
                                      '',
                                  width: 24,
                                )
                                    : Image(
                                  image:
                                  AssetImage(Assets.homeIcRoomLove),
                                  width: 24,
                                ),
                                const SizedBox(
                                  width: 4,
                                ),
                                Container(
                                  padding: EdgeInsets.fromLTRB(8, 1, 8, 1),
                                  decoration: BoxDecoration(
                                      borderRadius: BorderRadius.all(
                                          Radius.circular(10)),
                                      color: Color(newBgColors)),
                                  child: Text(mineRecentlyRoomList[index]
                                      .roomCategoryName ??
                                      '')
                                      .fontSize(10)
                                      .colorInt(newColors),
                                ),
                                Spacer(),
                                const Image(
                                  image: AssetImage(
                                    Assets.homeIcFire,
                                  ),
                                  width: 12,
                                  height: 12,
                                ),
                                const SizedBox(
                                  width: 5,
                                ),
                                Text(mineRecentlyRoomList[index]
                                    .scoreWeight
                                    .toString())
                                    .fontSize(12)
                                    .colorInt(0xffC1C1C1),
                              ],
                            ),
                          ],
                        ),
                      ).marginLeft(10).paddingRight(8.0),
                    )
                  ],
                )
                    .roundedRect(8)
                    .paddingAll(5)
                    .colorBg(bgColor: Colors.white)
                    .onClick(() {
                  controller.joinRoomPage(
                      context, mineRecentlyRoomList[index]);
                }),
              ],
            )
            );
          },
        ):Center(
          child: Column(
            children: [
              Image.asset(
                Assets.noData,
                fit: BoxFit.fill,
              ),
              Text(
                T.current.h4_no_room,
                style: const TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
              Text(
                T.current.h4_join_room,
                style: TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
            ],
          ),
        )
    );
  }

  Widget _mineRoomList(controller) {
    var myRoomList = widget.controller.myRoomList.value;
    String itemRoomNo = '';
    if(box.read('new_room') != null){
      itemRoomNo = box.read('new_room')['roomNo'];
    }
    return EasyRefresh(
        onRefresh: _onRefreshPopularRoom,
        onLoad: _onLoadRoom,
        header: buildCustomHeader,
        footer:buildCustomFooter,
        controller: _refreshControllerRoom,
        child: myRoomList.length > 0? MasonryGridView.count(
          crossAxisCount: 1,
          mainAxisSpacing: 6,
          crossAxisSpacing: 4,
          itemCount: myRoomList.length,
          itemBuilder: (context, index) {
            var newColors = 0;
            var newBgColors = 0;
            final roomCategoryColor = myRoomList[index].roomCategoryColor;
            if (roomCategoryColor != null) {
              String _color = '0xff' + roomCategoryColor.split('#')[1];
              newColors = _color.toInt();
            } else {
              newColors = 0xfffffff;
            }
            final backgroundUrl = myRoomList[index].backgroundUrl;
            if (backgroundUrl != null) {
              String _bgColor = '0xff' + backgroundUrl.split('#')[1];
              newBgColors = _bgColor.toInt();
            } else {
              newBgColors = 0xfffffff;
            }
            return Container(
                decoration: const BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(5))
            ),
            padding: const EdgeInsets.symmetric(vertical: 5),
            child:Column(
              children: [
                Row(
                  children: [
                    // Image.asset(roomItem.roomIcon,width: 100,height: 100,),
                    Container(
                        width: 73,
                        height: 73,
                        margin: const EdgeInsets.only(left: 5),
                        decoration: ShapeDecoration(
                            image: DecorationImage(
                              // image:index % 2 == 0 ? AssetImage(Assets.homeAvatar1) : AssetImage(Assets.homeAvatar2),
                                image: NetworkImage(
                                    myRoomList[index].roomIcon ?? ''),
                                fit: BoxFit.fitWidth),
                            shape: RoundedRectangleBorder(
                                borderRadius:
                                BorderRadiusDirectional.circular(8))),
                        child: Stack(
                          children: [
                            Positioned(
                                left: -2,
                                top: -1,
                                child: Image(image: itemRoomNo == myRoomList[index].roomNo&&controller.isNew.value ? const AssetImage(Assets.mineRoomNew) : const AssetImage(Assets.mineRoomClose) ,width: 40,height: 16,)
                            ),
                            Positioned(
                              left: 8,
                              child: Text(itemRoomNo == myRoomList[index].roomNo&&controller.isNew.value ? T.current.h3_new:(myRoomList[index].isActivate ?? true ?'Close' : T.current.h3_hide)).color(Colors.white).fontSize(11),
                            )
                          ],
                        )),
                    const SizedBox(
                      width: 5,
                    ),

                    Expanded(
                      child: SizedBox(
                        height: 73,
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  children: [
                                    // Image.network(myRoomList[index].countryUrl,width: 30,height: 20,),
                                    myRoomList[index].countryUrl != null
                                        ? Image.network(
                                      myRoomList[index].countryUrl,
                                      width: 30,
                                      height: 20,
                                    )
                                        : Image.asset(
                                      Assets.homeCountries,
                                      width: 30,
                                      height: 20,
                                    ),
                                    const SizedBox(
                                      width: 3,
                                    ),
                                    SizedBox(
                                      width: 180,
                                      child: Text(
                                        myRoomList[index].roomName ?? '',
                                        softWrap: false,
                                        maxLines: 1,
                                        overflow: TextOverflow.ellipsis,
                                      ).fontSize(16),
                                    )
                                  ],
                                ),
                                Text(
                                  myRoomList[index].slogan ?? '',
                                  softWrap: false,
                                  maxLines: 1,
                                  overflow: TextOverflow.ellipsis,
                                ).fontSize(12).color(Color(0xffC1C1C1)),
                              ],
                            ),
                            Row(
                              children: [
                                myRoomList[index].categoryTypeIcon != null
                                    ? Image.network(
                                  myRoomList[index].categoryTypeIcon ??
                                      '',
                                  width: 24,
                                )
                                    :const Image(
                                  image:
                                  AssetImage(Assets.homeIcRoomLove),
                                  width: 24,
                                ),
                                const SizedBox(
                                  width: 4,
                                ),
                                Container(
                                  padding:
                                  const EdgeInsets.fromLTRB(8, 1, 8, 1),
                                  decoration: BoxDecoration(
                                      borderRadius: const BorderRadius.all(
                                          Radius.circular(10)),
                                      color: Color(newBgColors)),
                                  child: Text(myRoomList[index]
                                      .roomCategoryName ??
                                      '')
                                      .fontSize(10)
                                      .colorInt(newColors),
                                ),
                                const Spacer(),
                                const Image(
                                  image: AssetImage(
                                    Assets.homeIcFire,
                                  ),
                                  width: 12,
                                  height: 12,
                                ),
                                const SizedBox(
                                  width: 5,
                                ),
                                Text(myRoomList[index].scoreWeight.toString())
                                    .fontSize(12)
                                    .colorInt(0xffC1C1C1),
                              ],
                            ),
                          ],
                        ),
                      ).marginLeft(10).paddingRight(8.0),
                    )
                  ],
                )
                    .roundedRect(8)
                    .paddingAll(5)
                    .colorBg(bgColor: Colors.white)
                    .onClick(() {
                  // controller.joinRoomPage(context, myRoomList[index]);
                  RoomManager.instance.joinRoom(myRoomList[index].roomNo);
                }),
              ],
            )
            );
          },
        ):Center(
          child: Column(
            children: [
              Image.asset(
                Assets.noData,
                fit: BoxFit.fill,
              ),
              Text(
                T.current.h4_no_room,
                style: const TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
               Text(
                 T.current.h4_join_room,
                style: TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
            ],
          ),
        )
    );
  }

  Widget _mineFollowingRoomList(controller) {
    var myRoomList = widget.controller.followingRoomList.value;
    return EasyRefresh(
        onRefresh: _onRefreshPopularRoom,
        onLoad: _onLoadRoom,
        header: buildCustomHeader,
        footer:buildCustomFooter,
        controller: _refreshControllerRoom,
        child:myRoomList.length > 0? MasonryGridView.count(
          crossAxisCount: 1,
          mainAxisSpacing: 6,
          crossAxisSpacing: 4,
          itemCount: myRoomList.length,
          itemBuilder: (context, index) {
            var newColors = 0;
            var newBgColors = 0;
            final roomCategoryColor = myRoomList[index].roomCategoryColor;
            if (roomCategoryColor != null) {
              String _color = '0xff' + roomCategoryColor.split('#')[1];
              newColors = _color.toInt();
            } else {
              newColors = 0xfffffff;
            }
            final backgroundUrl = myRoomList[index].backgroundUrl;
            if (backgroundUrl != null) {
              String _bgColor = '0xff' + backgroundUrl.split('#')[1];
              newBgColors = _bgColor.toInt();
            } else {
              newBgColors = 0xfffffff;
            }
            return Container(
                decoration: const BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(5))
            ),
            padding: const EdgeInsets.symmetric(vertical: 5),
            child:Column(
              children: [
                Row(
                  children: [
                    // Image.asset(roomItem.roomIcon,width: 100,height: 100,),
                    Container(
                        width: 73,
                        height: 73,
                        margin: EdgeInsets.only(left: 5),
                        decoration: ShapeDecoration(
                            image: DecorationImage(
                              // image:index % 2 == 0 ? AssetImage(Assets.homeAvatar1) : AssetImage(Assets.homeAvatar2),
                                image: NetworkImage(
                                    myRoomList[index].roomIcon ?? ''),
                                fit: BoxFit.fitWidth),
                            shape: RoundedRectangleBorder(
                                borderRadius:
                                BorderRadiusDirectional.circular(8))),
                        // child: Stack(
                        //   children: [
                        //     Positioned(
                        //       left: -2,
                        //       top: -1,
                        //       child: Image(
                        //         image: myRoomList[index].isLock ?? false
                        //             ? AssetImage(Assets.mineRoomClose)
                        //             : AssetImage(Assets.mineRoomNew),
                        //         width: 40,
                        //         height: 16,
                        //       ),
                        //     ),
                        //     Positioned(
                        //       left: 8,
                        //       child: Text(myRoomList[index].isLock ?? false
                        //           ? 'Hiding'
                        //           : 'New')
                        //           .color(Colors.white)
                        //           .fontSize(11),
                        //     )
                        //   ],
                        // )
                    ),
                    const SizedBox(
                      width: 5,
                    ),
                    Expanded(
                      child: SizedBox(
                        height: 73,
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  children: [
                                    myRoomList[index].countryUrl != null
                                        ? Image.network(
                                      myRoomList[index].countryUrl,
                                      width: 30,
                                      height: 20,
                                    )
                                        : Image.asset(
                                      Assets.homeCountries,
                                      width: 30,
                                      height: 20,
                                    ),
                                    // Image.asset(Assets.homeCountries,width: 30,height: 20,),
                                    SizedBox(
                                      width: 3,
                                    ),
                                    SizedBox(
                                      width: 180,
                                      child: Text(
                                        myRoomList[index].roomName ?? '',
                                        softWrap: false,
                                        maxLines: 1,
                                        overflow: TextOverflow.ellipsis,
                                      ).fontSize(16),
                                    )
                                  ],
                                ),
                                Text(
                                  myRoomList[index].slogan ?? '',
                                  softWrap: false,
                                  maxLines: 1,
                                  overflow: TextOverflow.ellipsis,
                                ).fontSize(12).color(Color(0xffC1C1C1)),
                              ],
                            ),
                            Row(
                              children: [
                                myRoomList[index].categoryTypeIcon != null
                                    ? Image.network(
                                  myRoomList[index].categoryTypeIcon ??
                                      '',
                                  width: 24,
                                )
                                    : Image(
                                  image:
                                  AssetImage(Assets.homeIcRoomLove),
                                  width: 24,
                                ),
                                SizedBox(
                                  width: 4,
                                ),
                                Container(
                                  child: Text(myRoomList[index]
                                      .roomCategoryName ??
                                      '')
                                      .fontSize(10)
                                      .colorInt(newColors),
                                  padding: EdgeInsets.fromLTRB(8, 1, 8, 1),
                                  decoration: BoxDecoration(
                                      borderRadius: BorderRadius.all(
                                          Radius.circular(10)),
                                      color: Color(newBgColors)),
                                ),
                                Spacer(),
                                Image(
                                  image: AssetImage(
                                    Assets.homeIcFire,
                                  ),
                                  width: 12,
                                  height: 12,
                                ),
                                SizedBox(
                                  width: 5,
                                ),
                                Text(myRoomList[index].scoreWeight.toString())
                                    .fontSize(12)
                                    .colorInt(0xffC1C1C1),
                              ],
                            ),
                          ],
                        ),
                      ).marginLeft(10).paddingRight(8.0),
                    )
                  ],
                )
                    .roundedRect(8)
                    .paddingAll(5)
                    .colorBg(bgColor: Colors.white)
                    .onClick(() {
                  controller.joinRoomPage(context, myRoomList[index]);
                }),
              ],
            )
            );
          },
        ):Center(
          child: Column(
            children: [
              Image.asset(
                Assets.noData,
                fit: BoxFit.fill,
              ),
              Text(
                T.current.h4_no_room,
                style: const TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
              Text(
                T.current.h4_join_room,
                style: TextStyle(color: Color(0xffc1c1c1), fontSize: 12),
              ),
            ],
          ),
        )
    );
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: DefaultTabController(
        length: 3,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            TabBar(
              controller: _tabController,
              tabAlignment: TabAlignment.center,
              padding: EdgeInsets.zero,
              dividerColor: Color(0xffFAFAFA),
              indicatorColor: Color(0xffFAFAFA),
              splashFactory: NoSplash.splashFactory,
              isScrollable: true,
              // labelStyle: TextStyle(color: Color(0xff1B1B1B), fontSize: 18, fontWeight: FontWeight.w600),
              // unselectedLabelStyle: TextStyle(color: Color(0xffA397DE), fontSize: 18),
              tabs: [
                Tab(
                    child: Column(
                  children: [
                    Container(
                      padding: EdgeInsets.all(5),
                      child: Text(widget.controller.roomTypesList.value.length >
                                  2
                              ? widget.controller.roomTypesList.value[2].name
                              : "Recently")
                          .fontSize(16)
                          .fontWeight(FontWeight.bold)
                          .color(currentId == 0
                              ? Color(0xff8A72FE)
                              : Colors.black),
                    ),
                    currentId == 0
                        ? Image(
                            image: AssetImage(Assets.homeTabBottom),
                            width: 18,
                          )
                        : SizedBox(
                            height: 10,
                          )
                  ],
                )),
                Tab(
                    child: Column(
                  children: [
                    Container(
                      padding: EdgeInsets.all(5),
                      child: Text(widget.controller.roomTypesList.value.length >
                                  2
                              ? widget.controller.roomTypesList.value[1].name
                              : "Owner")
                          .fontSize(16)
                          .fontWeight(FontWeight.bold)
                          .color(currentId == 1
                              ? Color(0xff8A72FE)
                              : Colors.black),
                    ),
                    currentId == 1
                        ? Image(
                            image: AssetImage(Assets.homeTabBottom),
                            width: 18,
                          )
                        : SizedBox(
                            height: 10,
                          )
                  ],
                )),
                Tab(
                    child: Column(
                  children: [
                    Container(
                      padding: EdgeInsets.all(5),
                      child: Text(widget.controller.roomTypesList.value.length >
                                  2
                              ? widget.controller.roomTypesList.value[0].name
                              : "Collection")
                          .fontSize(16)
                          .fontWeight(FontWeight.bold)
                          .color(currentId == 2
                              ? Color(0xff8A72FE)
                              : Colors.black),
                    ),
                    currentId == 2
                        ? Image(
                            image: AssetImage(Assets.homeTabBottom),
                            width: 18,
                          )
                        : SizedBox(
                            height: 10,
                          )
                  ],
                )),
              ],
            ),
            Expanded(
                child: Listener(
              onPointerMove: (PointerMoveEvent event) {
                double deltaX = event.delta.dx;
                double dy = event.delta.dy;
                if (dy < 10 && dy > -10 && deltaX > 15) {
                  if (_tabController.index == 0 && !LanguageUtil().isRTL()) {
                    widget.callback('left');
                  }
                }

                if (dy < 10 && dy > -10 && deltaX < -15) {

                  if (_tabController.index == 0 && LanguageUtil().isRTL()) {
                    widget.callback('right');
                  }

                }
              },
              child: TabBarView(controller: _tabController, children: [
                _mineRecentlyRoomList(widget.controller),
                _mineRoomList(widget.controller),
                _mineFollowingRoomList(widget.controller),
              ]),
            )
            ),
            const SizedBox(height: 50,)
          ],
        ),
      ),
    );
  }
}
